{% load system_tags %}
<!-- pagination -->
{% if is_paginated %}
    <ul class="nav nav-sm nav-invert rounded-pill">
        {% if page_obj.has_previous %}
            <li class="nav-item">
                <a class="nav-link px-3" href="?{% query_transform page=page_obj.previous_page_number %}"
                   tabindex="-1">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
        {% endif %}
        {% for page in page_obj.pages %}
            {% if page %}
                {% ifequal page page_obj.number %}
                    <a class="nav-link px-3 active">{{ page }}</a>
                {% else %}
                    <a class="nav-link px-3"
                       href="?{% query_transform page=page %}">{{ page }}</a>
                {% endifequal %}
            {% else %}
                <li class="nav-item disabled">
                    <a class="nav-link px-3" href="#" tabindex="-1">...</a>
                </li>
            {% endif %}
        {% endfor %}

        {% if page_obj.has_next %}
            <li class="nav-item">
                <a class="nav-link px-3" href="?{% query_transform page=page_obj.next_page_number %}">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        {% endif %}

    </ul>
{% endif %}
